package com.dhcc.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dhcc.dao.TrainPlanDao;
import com.dhcc.dto.TrainTeaRel;
import com.dhcc.model.CouMat;
import com.dhcc.model.TrainPlan;
import com.dhcc.service.TrainPlanService;
import com.dhcc.utils.PageControl;
import com.dhcc.utils.Pager;

@Transactional
@Service("trainPlanService")
public class TrainPlanServiceImpl implements TrainPlanService{

	@Autowired
	private TrainPlanDao tpd;
	
	@Override
	public void save(TrainPlan tp) {
		tpd.save(tp);
	}

	@Override
	public void update(TrainPlan tp) {
		tpd.update(tp);
	}

	@Override
	public void delete(TrainPlan tp) {
		tpd.delete(tp);
	}

	@Override
	public TrainPlan get(Long id) {
		TrainPlan trainPlan = tpd.get(id);
		return trainPlan;
	}

	@Override
	public List<TrainPlan> query() {
		List<TrainPlan> list = tpd.query();
		return list;
	}

	@Override
	public List<TrainTeaRel> queryTea() {
		List<TrainTeaRel> list = tpd.queryTea();
		return list;
	}

	@Override
	public Pager<TrainTeaRel> queryPage(int currentPage) {
		
		PageControl pageControl = new PageControl();
		pageControl.setCurrentIndex(currentPage);
		
		return tpd.queryPage(pageControl);
	}

}
